package com.mayo.feaf;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageButton;

import com.mayo.feaf.comun.BaseActivity;

public class IndumentariasActivity extends BaseActivity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
        this.setContentBanderas();
        
        actionBar.setTitle(R.string.menu_entrada_expo);
        actionBar.setSubtitle(R.string.tit_ind_tradicionales);
        actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_TITLE
				| ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_HOME_AS_UP
				| ActionBar.DISPLAY_SHOW_CUSTOM);
        
        for (int i = 0; i < listaBanderas.size() ; i++) {
        	ImageButton bandera = listaBanderas.get(i);
        	final String comunidad = String.valueOf(i+1);
        	bandera.setOnClickListener(new OnClickListener() {
			
				@Override
				public void onClick(View v) {
					Intent intent = new Intent(getApplicationContext(), GaleriaIndumentariasActivity.class);
					intent.putExtra("comunidad", comunidad);
					startActivity(intent);
				}
			});
        }
    }
    
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
        case android.R.id.home:
            this.finish();
            return true;
        default:
            return super.onOptionsItemSelected(item);
        }
    }
}
